/*
 Copyright (C) 2008  Maurizio Monticelli

 This program is free software; you can redistribute it and/or modify it under the terms of the 
 GNU General Public License as published by the Free Software Foundation; either version 2 of the 
 License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
 even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 
 Public License for more details.

 You should have received a copy of the GNU General Public License along with this program; if not, write 
 to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 
*/

package ch.justdoit.andriodrpncalc.view;

import android.content.Context;
import android.widget.AbsoluteLayout;
import ch.justdoit.andriodrpncalc.model.Model;
import ch.justdoit.andriodrpncalc.model.command.*;
import ch.justdoit.andriodrpncalc.view.buttons.*;

public class KeyEvaluateCommands extends AbsoluteLayout{
	private Model model;
	
	public int WIDTH = 90;
	public int HEIGHT = 120;
	
	public KeyEvaluateCommands(Context context,  Model _model) {
		super(context);
		model = _model;
		
		int x = 0;
		int y = 0;

		ButtonKey btn1 = new ButtonKey(context, model, "(");
		addView(btn1, 
    			new AbsoluteLayout.LayoutParams(btn1.WIDTH, btn1.HEIGHT, x , y)
    	);
		x = x + btn1.WIDTH;
		
		ButtonKey btn2 = new ButtonKey(context, model, ")");
		addView(btn2, 
    			new AbsoluteLayout.LayoutParams(btn2.WIDTH, btn2.HEIGHT, x , y)
    	);
		x = x + btn2.WIDTH;
		
		ButtonCommand btnTangens = new ButtonCommand(context, model, new TanCommand(model));
		addView(btnTangens, 
    			new AbsoluteLayout.LayoutParams(btnTangens.WIDTH, btnTangens.HEIGHT, x , y)
    	);
		x = x + btnTangens.WIDTH;
		
		ButtonCommand btnCos = new ButtonCommand(context, model, new CosCommand(model));
		addView(btnCos, 
    			new AbsoluteLayout.LayoutParams(btnCos.WIDTH, btnCos.HEIGHT, x, y)
    	);
		x = x + btnCos.WIDTH;
		
		ButtonCommand btnSinus = new ButtonCommand(context, model, new SinCommand(model));
		addView(btnSinus, 
    			new AbsoluteLayout.LayoutParams(btnSinus.WIDTH, btnSinus.HEIGHT, x, y)
    	);
		x = x + btnSinus.WIDTH;
		
		ButtonKey btn4 = new ButtonKey(context, model, "");
		addView(btn4, 
    			new AbsoluteLayout.LayoutParams(btn4.WIDTH, btn4.HEIGHT, x , y)
    	);

			
		x = x + btn4.WIDTH;
		y = y + btn4.HEIGHT;
		
		WIDTH = x;
		HEIGHT = y;
	}

	
	
	

}
